<?php
session_start();
include 'nav.inc.php';
html_head('Übersicht - Krankheitstage');
include 'dbConn.php';
if(!isset($_SESSION["username"])){
	echo("</head>");
	echo("<body>");
	echo("<div class='content'>");
	echo ("Bitte erst <a href='../login.php'>einloggen</a>.");
	exit;
	echo("</div>");
	echo("</body>");
	echo("</html>");
}
else{
	if (isset($_REQUEST['jahr']))
		$jahr = $_REQUEST['jahr'];
	else
		$jahr = date("Y");
	echo("<link rel='stylesheet' type='text/css' href='tcal.css' />");
	echo("<script type='text/javascript' src='tcal.js'></script> ");
	echo("<script type='text/javascript' src='clone_this.js'></script> ");
	echo("</head>");
	echo("<body>");
	menu();
	echo("<div class='content'>");
	echo("<h3>Krankenschein ");
	echo $jahr;
	echo("</h3>");
	echo("<table>");
	echo("<tr>");
	echo("<th>Monat</th>");
	echo("<th>Krankheitstage</th>");
	echo("</tr>");
	for ($tmp=1; $tmp<=12; $tmp++){
		echo ("<tr>");
		echo ("<td align='left'>".$dbStunden->showMonatsName($tmp)."</td>");
		$days = $dbStunden->countKrank($_SESSION['userid'], $jahr, $tmp);
		echo ("<td align='center'>".$days."</td>\n");		
		echo("</tr>");
		mysql_free_result($result);
	}
	echo("</table>");
	echo("</div>");
}
?>
</body>
</html>

